package copyFile;

import java.io.FileInputStream;
import java.io.FileOutputStream;

public class CopyFile {
	public void copyfile(String path,String destinationpath) {
		try {
			FileInputStream fis=new FileInputStream(path);
			FileOutputStream fos=new FileOutputStream(destinationpath);
			byte datas[]=new byte[1024*8];
			int len=0;
			while((len=fis.read(datas))!=-1) {
				fos.write(datas,0,len);
			}
			fis.close();
			fos.close();
		}catch(Exception e) {
			e.printStackTrace();
		}
	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		CopyFile c=new CopyFile();
		c.copyfile("D:\\play.jpg","D:\\play\\play.jpg");
	}

}
